#include <iostream>
#include <string>
using namespace std;

class person
{
protected:
    string no;
    string name;
    int age;
    bool gender;
    string department;

    void input()
    {
        cout<<"no:";
        cin>>this->no;
        cout<<"name:";
        cin>>this->name;
        cout<<"age:";
        cin>>this->age;
        cout<<"gender(M/F):";
        string g;
        cin>>g;
        if(g=="M")
            this->gender=true;
        else
            this->gender=false;
        cout<<"department:";
        cin>>this->department;
    }

public:
    virtual void Print()=0;
};

void person::Print()
{
    cout<<"no:"<<this->no<<endl;
    cout<<"name:"<<this->name<<endl;
    cout<<"age:"<<this->age<<endl;
    cout<<"department:"<<this->department<<endl;
    cout<<"gender:";
    if(this->gender)
        cout<<"male";
    else
        cout<<"female";
    cout<<endl;
}

class doctor : public person
{
private:
    string professionalTitle;
    //string diagnosisDetail;

public:
    /*doctor(string no,string name,int age,bool gender,string department,string professionalTitle):
        professionalTitle(professionalTitle)
    {
        this->no=no;
        this->name=name;
        this->age=age;
        this->gender=gender;
        this->department=department;
    }*/

    void onDuty()
    {
        input();
        cout<<"professional Title:";
        cin>>this->professionalTitle;
    }

    void Diagnose(string illnessDetail, string &treatmentDetail)
    {
        cout<<"illness Detail:"<<illnessDetail<<endl;
        cout<<"treatment Detail:";
        cin>>treatmentDetail;
    }

    virtual void Print()
    {
        person::Print();
        cout<<"professional Title:"<<this->professionalTitle<<endl;
    }
};

class patients : public person
{
private:
    string illnessDetails;
    string treatmentDetails;

public:
    virtual void Print()
    {
        person::Print();
        cout<<"illness Details:"<<this->illnessDetails<<endl;
        cout<<"treatment Details:"<<this->treatmentDetails<<endl;
    }

    void SeeDoctor(doctor &doc)
    {
        cout<<"illness Details:";
        cin>>this->illnessDetails;
        doc.Diagnose(this->illnessDetails,this->treatmentDetails);
    }

    void Register()
    {
        input();
    }
};

int main()
{
    patients p;
    p.Register();
    doctor d;
    d.onDuty();
    p.SeeDoctor(d);
    p.Print();
    d.Print();
}
